// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: Do sabotage
// -----------------------------------------------

private ["_object","_light","_param"];

_object = _this select 0;
_param  = _this select 3;

if (count _param == 0) then {_light = false} else {_light = true};

wcgarbage = ["Sabotage", localize "STR_WC_MESSAGESABOTING", localize "STR_WC_MESSAGESABOTINGINFORMATION", 8] spawn WC_fnc_playerhint;
player playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 8;
if !(alive player) exitWith {};

wcgarbage = ["Sabotage", localize "STR_WC_MESSAGESABOTINGFINISHED", localize "STR_WC_MESSAGESABOTINGINFORMATION", 8] spawn WC_fnc_playerhint;

_object setVariable ["wcsabotage", true, true];

//A3 TODO: setVehicleInit
_object setVehicleInit "this removeAction 0;";
processInitCommands;

if (_light) then {
	_object setVehicleInit "{_x switchLight 'OFF'} foreach (this nearObjects ['Streetlamp', 400]);";
	processInitCommands;
};